{% trans_default_domain 'FOSUserBundle' %}


    <div class="row">
        {% if error %}
            <div class="alert alert-warning" role="alert">
                登陆失败，请确认用户名与密码是否正确（{{ error.messageKey|trans(error.messageData, 'security') }}）
            </div>
        {% endif %}

        <div class="col-sm-4 col-sm-offset-4 form-box">
            <form action="{{ path("fos_user_security_check") }}" method="post" class="form-horizontal form">
                {% if csrf_token %}
                    <input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />
                {% endif %}

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">{{ 'security.login.username'|trans }}</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" class="form-control" id="username" name="_username" value="{{ last_username }}" required="required" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">{{ 'security.login.password'|trans }}</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="password" class="form-control" id="password" name="_password" required="required" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="checkbox" id="remember_me" name="_remember_me" value="on" />
                        <label for="remember_me">{{ 'security.login.remember_me'|trans }}</label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="submit" class="btn btn-default" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans }}" />
                        <a href="/register">
                            <button type="button" class="btn btn-success">注册</button>
                        </a>
                    </div>
                </div>
            </form>
        </div>
    </div>

